package org.apache.zookeeper.inspector.encryption;

public class GBKDataEncryptionManager implements DataEncryptionManager{
	private static final String CHARSET = "UTF-8";

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.apache.zookeeper.inspector.encryption.DataEncryptionManager#decryptData
	 * (byte[])
	 */
	public String decryptData(byte[] encrypted) throws Exception
	{
		return new String(encrypted,CHARSET);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.apache.zookeeper.inspector.encryption.DataEncryptionManager#encryptData
	 * (java.lang.String)
	 */
	public byte[] encryptData(String data) throws Exception
	{
		if (data == null)
		{
			return new byte[0];
		}
		return data.getBytes(CHARSET);
	}

}
